package entity.innerClass.lianxi.test.demo02;

import entity.innerClass.lianxi.test.JiSuan;

/*
* 匿名方式，便于维护，扩展*/
public class MainTest01 {
    public static void main(String[] args) {
        JiSuan js = new JiSuan() {
            @Override
            public int js(int num, int num1) {
                return num + num1;
            }
        };
        System.out.println(js.js(53, 20));

        JiSuan js01 = new JiSuan() {
            @Override
            public int js(int num, int num1) {
                return num - num1;
            }
        };
        System.out.println(js01.js(53, 20));

        JiSuan js02 = new JiSuan() {
            @Override
            public int js(int num, int num1) {
                return num * num1;
            }
        };
        System.out.println(js02.js(53, 20));

        JiSuan js03 = new JiSuan() {
            @Override
            public int js(int num, int num1) {
                return num / num1;
            }
        };
        System.out.println(js03.js(53, 20));
    }
}
